<?php
/**
 * User: yuesir
 * Date: 2016/4/28
 * Time: 22:57
 */

namespace Lib;


class ColorDecorator implements DrawDecorator
{
    public function __construct($color = 'red')
    {
        $this->color = $color;
    }

    function beforeDraw()
    {
        echo "<div style='color:{$this->color}'>";
    }

    function afterDraw()
    {
        echo '</div>';
    }
}